//
import httpUtils from '@/core/utils/http.utils';
const urls = {
  page: `/api/sjhj/exp/page`,
  add: `/api/sjhj/exp/add`, //添加实验
  dataPage: `/api/sjhj/datares/page`, //数据资源
  hardPage: `/api/sjhj/hardwareres/page`, //硬件资源
  modelPage: `/api/sjhj/modelres/page`, //模型资源,
  experType: '/api/upms/sysDictItem/getDItemByDType/data_exper_type', // 实验类型,
  experTypeByName: '/api/upms/sysDictItem/getDItemByDType/', // 实验类型,
  resultApl: '/api/upms/sysDictItem/getDItemByDType/result_apl', // 结果提交方式,
  // 'techVeriType': '/api/upms/sysDictItem/getDItemByDType/tech_veri', // 实验类型-数据汇聚等,
  techVeriType: '/api/upms/sysDictItem/getDItemByDType/jxexplo_model_type', // 实验类型-数据汇聚等,
  checkType: '/api/upms/sysDictItem/getDItemByDType/exper_state', //实验审核--实验状态,
  selectResource: `/api/sjhj/exp/selectResource`, //,
  resultAdd: `/api/sjhj/result/add`, //,成果添加
  resultUpdate: `/api/sjhj/result/update`, //,成果更新
  getResult: `/api/sjhj/result/`, //,获取成果列表
  deleteExper: `/api/sjhj/exp/`, //,删除实验
  updateResult: `/api/sjhj/exp/addR`, //,更新资源
  resultDownload: '/api/sjhj/result/exportResultExcelByExpId/', // 成果下载
  resultUpload: '/api/sjhj/result/upload', //实验成果上传
  resourceDownload: '/api/sjhj/resapl/exportResAplExcelByExpId/', // 资源下载
  updateExp: '/api/sjhj/exp/updateExp', // 开启结束实验
  approve: '/api/sjhj/exp/urge/', // 催批
  check: `/api/sjhj/exp/check`, //模型资源,
  textCheck: '/api/sjhj/exp/check', // 实验审核
  textChecks: '/api/sjhj/exp/checks', // 批量实验审核
  testDetail: `/api/sjhj/exp/`, // 实验详情
  selectResource: '/api/sjhj/exp/selectResource/', // 资源详情
  rushApproval: '/api/sjhj/urge/page/', //催批
  getRushAppInfo: '/api/sjhj/exp/urge/', // 根据id获取催批信息
  getRoleName: '/api/sjhj/exp/getrolename/', // 获取角色名
  getType: '/api/upms/sysDictItem/getDItemByDType/dict_tsmx_type', //探索实验--威胁分析实验管理--实验类型,
};
// service methods
const experApi = {
  getPage(params) {
    return httpUtils.get(urls.page, params);
  },
  add(params) {
    return httpUtils.postRequest(urls.add, params);
  },
  updateResult(params) {
    return httpUtils.postRequest(urls.updateResult, params);
  },
  updateExp(params) {
    return httpUtils.postRequest(urls.updateExp, params);
  },
  deleteExper(params) {
    return httpUtils.delete(urls.deleteExper + params);
  },
  resultAdd(params) {
    return httpUtils.postRequest(urls.resultAdd, params);
  },
  resultUpdate(params) {
    return httpUtils.postRequest(urls.resultUpdate, params);
  },
  getResult(params) {
    return httpUtils.get(urls.getResult + params);
  },
  dataPage(params) {
    return httpUtils.get(urls.dataPage, params);
  },
  hardPage(params) {
    return httpUtils.get(urls.hardPage, params);
  },
  modelPage(params) {
    return httpUtils.get(urls.modelPage, params);
  },
  experType(params) {
    return httpUtils.get(urls.experType, params);
  },
  experTypeByName(params) {
    return httpUtils.get(urls.experTypeByName + params);
  },
  resultApl(params) {
    return httpUtils.get(urls.resultApl, params);
  },
  selectResource(params) {
    return httpUtils.get(urls.selectResource, params);
  },
  resultDownload(expId, fileName) {
    return httpUtils.downloadUrlMode(urls.resultDownload + expId, 'post', fileName, null, 'xlsx');
  },
  resultUpload(params) {
    return httpUtils.uploadFile(urls.resultUpload, params);
  },
  resourceDownload(expId, fileName) {
    return httpUtils.downloadUrlMode(urls.resourceDownload + expId, 'post', fileName, null, 'xlsx');
  },
  approve(expId) {
    return httpUtils.postRequest(urls.approve + expId);
  },
  techVeri(params) {
    return httpUtils.get(urls.techVeriType, params);
  },
  checkType(params) {
    return httpUtils.get(urls.checkType, params);
  },
  check(params) {
    return httpUtils.get(urls.check, params);
  },
  textCheck(params) {
    return httpUtils.post(urls.textCheck, params);
  },
  textChecks(params) {
    return httpUtils.post(urls.textChecks, params);
  },
  testDetail(params) {
    return httpUtils.get(urls.testDetail + params);
  },
  selectResource(params) {
    return httpUtils.get(urls.selectResource, params);
  },
  rushApproval(params) {
    return httpUtils.get(urls.rushApproval + params);
  },
  getRushAppInfo(params) {
    return httpUtils.post(urls.getRushAppInfo + params);
  },
  getRoleName(param) {
    return httpUtils.get(urls.getRoleName + param);
  },
  getType(params) {
    return httpUtils.get(urls.getType, params);
  },
};

export default experApi;
